package iwpl.project.entities;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Employees entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Employees")
public class Employees implements java.io.Serializable {

	// Fields

	private Integer id;
	private Offices offices;
	private String fullName;
	private Timestamp birthday;
	private String address;
	private String sex;
	private String phone;
	private Set<Contracts> contractses = new HashSet<Contracts>(0);
	private Set<EquipmentHistories> equipmentHistorieses = new HashSet<EquipmentHistories>(
			0);
	private Set<Accounts> accountses = new HashSet<Accounts>(0);

	// Constructors

	/** default constructor */
	public Employees() {
	}

	/** minimal constructor */
	public Employees(Integer id, String fullName, Timestamp birthday) {
		this.id = id;
		this.fullName = fullName;
		this.birthday = birthday;
	}

	/** full constructor */
	public Employees(Integer id, Offices offices, String fullName,
			Timestamp birthday, String address, String sex, String phone,
			Set<Contracts> contractses,
			Set<EquipmentHistories> equipmentHistorieses,
			Set<Accounts> accountses) {
		this.id = id;
		this.offices = offices;
		this.fullName = fullName;
		this.birthday = birthday;
		this.address = address;
		this.sex = sex;
		this.phone = phone;
		this.contractses = contractses;
		this.equipmentHistorieses = equipmentHistorieses;
		this.accountses = accountses;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "OfficeID")
	public Offices getOffices() {
		return this.offices;
	}

	public void setOffices(Offices offices) {
		this.offices = offices;
	}

	@Column(name = "FullName", nullable = false)
	public String getFullName() {
		return this.fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	@Column(name = "Birthday", nullable = false, length = 16)
	public Timestamp getBirthday() {
		return this.birthday;
	}

	public void setBirthday(Timestamp birthday) {
		this.birthday = birthday;
	}

	@Column(name = "Address")
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "Sex")
	public String getSex() {
		return this.sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	@Column(name = "Phone", length = 20)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "employees")
	public Set<Contracts> getContractses() {
		return this.contractses;
	}

	public void setContractses(Set<Contracts> contractses) {
		this.contractses = contractses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "employees")
	public Set<EquipmentHistories> getEquipmentHistorieses() {
		return this.equipmentHistorieses;
	}

	public void setEquipmentHistorieses(
			Set<EquipmentHistories> equipmentHistorieses) {
		this.equipmentHistorieses = equipmentHistorieses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "employees")
	public Set<Accounts> getAccountses() {
		return this.accountses;
	}

	public void setAccountses(Set<Accounts> accountses) {
		this.accountses = accountses;
	}

}